PICTools Programmer's Reference
Auto-Contrast Correction

The automatic contrast correction algorithm analyzes and corrects the brightness and contrast of 8 and 24-bit images.  It requires no user input.

The analysis phase samples pixels in the image during the REQ_INIT phase, and calculates the background brightness and variation, and estimates the contrast and noise.  The brightness is the local average level, the noise and contrast measure are measured relative to this value.  The variance is the difference between the brightest and darkest local averages across the page

The correction phase uses the data obtained during analysis to perform the correction during REQ_EXEC.  The correction method used during correction is returned. If the image requires no correction, the algorithm will return SCANFIX_OK_CONTRAST, indicating that no action was taken.  A value of SCANFIX_BAD_CONTRAST indicates that the noise level and contrast levels were too close and corrective action would not improve the image.  A value of SCANFIX_GLOBAL_CONTRAST or SCANFIX_ADAPTIVE_CONTRAST indicates that the specified method was used to correct the image.

The correction phase returns the parameters that were used for altering the image brightness.  These parameters are based on percentile brightness of each pixel.  Valid values for percentiles range from -1 to 101.  Values between 0 and 100 represent the given percentile brightness; a value of 90, for instance, will represent a brightness that is greater than 90 percent of sampled pixels, and less than 10 percent of sampled pixels.  A value of 0 will use the darkest sampled pixel value, while a value of 100 will use the brightest sampled pixel value. The values -1 and 101 are special values; -1 corresponds to a brightness of 0, and 101 corresponds to a brightness of 255, regardless of the contents of the image.  Should the automatic adjustment not provide suitable results, then these returned values can be used as the basis for using the manual brightness contrast correction subcode.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback